package com.foruo.learn.designmode.observer;

public class TestMe {

    public static void main(String[] args){
        Publisher publisher = new Publisher();

        // 订阅
        OneSub one = new OneSub();
        one.subscribe(publisher);

        SecondSub second = new SecondSub();
        second.subscribe(publisher);

        // 发布消息
        publisher.publish("测试消息");
    }

}
